package com.ruoyi.parking.service.impl;

import com.ruoyi.parking.domain.ParkOrder;
import com.ruoyi.parking.dto.OrderAndCar;
import com.ruoyi.parking.mapper.ParkOrderMapper;
import com.ruoyi.parking.service.IParkOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单信息Service业务层处理
 * 
 * @author chenkai
 * @date 2025-02-10
 */
@Service
public class ParkOrderServiceImpl implements IParkOrderService 
{
    @Autowired
    private ParkOrderMapper parkOrderMapper;

    /**
     * 查询订单信息
     * 
     * @param orderId 订单信息主键
     * @return 订单信息
     */
    @Override
    public ParkOrder selectParkOrderByOrderId(Integer orderId)
    {
        return parkOrderMapper.selectParkOrderByOrderId(orderId);
    }

    /**
     * 查询订单信息列表
     *
     * @param orderAndCar 订单信息
     * @return 订单信息
     */
    @Override
    public List<OrderAndCar> selectParkOrderList(OrderAndCar orderAndCar)
    {
        return parkOrderMapper.selectParkOrderList(orderAndCar);
    }

    /**
     * 新增订单信息
     * 
     * @param parkOrder 订单信息
     * @return 结果
     */
    @Override
    public int insertParkOrder(ParkOrder parkOrder)
    {
        return parkOrderMapper.insertParkOrder(parkOrder);
    }

    /**
     * 修改订单信息
     * 
     * @param parkOrder 订单信息
     * @return 结果
     */
    @Override
    public int updateParkOrder(ParkOrder parkOrder)
    {
        return parkOrderMapper.updateParkOrder(parkOrder);
    }

    /**
     * 批量删除订单信息
     * 
     * @param orderIds 需要删除的订单信息主键
     * @return 结果
     */
    @Override
    public int deleteParkOrderByOrderIds(Integer[] orderIds)
    {
        return parkOrderMapper.deleteParkOrderByOrderIds(orderIds);
    }

    /**
     * 删除订单信息信息
     * 
     * @param orderId 订单信息主键
     * @return 结果
     */
    @Override
    public int deleteParkOrderByOrderId(Integer orderId)
    {
        return parkOrderMapper.deleteParkOrderByOrderId(orderId);
    }
}
